﻿namespace WMS6.Web.Inventory
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class CCReleaseLogQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlCreateBy;
        protected DropDownList ddlLocID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReleaseDate;
        protected DropDownList ddlReleaseID;
        protected DropDownList ddlSkuID;
        protected HtmlForm F5520;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img1;
        protected HtmlImage img2;
        protected Label lblCreateBy;
        protected Label lblLocID;
        protected Label lblOwnerID;
        protected Label lblReceiptQuery;
        protected Label lblReleaseDate;
        protected Label lblReleaseID;
        protected Label lblSkuID;
        protected HtmlLink mycss;
        protected TextBox txtCreateBy;
        protected TextBox txtLocID;
        protected TextBox txtOwnerID;
        protected TextBox txtReleaseDate;
        protected TextBox txtReleaseDate2;
        protected TextBox txtReleaseID;
        protected TextBox txtSkuID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("CCReleaseLogList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlReleaseID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlLocID, 0);
            base.InitQueryDDL(this.ddlCreateBy, 0);
            base.InitQueryDDL(this.ddlReleaseDate, 1);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.InitPage(this.Page);
            this.InitDropDownLists();
        }

        public string CreateBy
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreateBy.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreateBy.Text.Trim(), this.ddlCreateBy.SelectedValue);
                }
                return "";
            }
        }

        public string Loc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLocID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLocID.Text.Trim(), this.ddlLocID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReleaseDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReleaseDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReleaseDate.Text.Trim(), this.ddlReleaseDate.SelectedValue, this.txtReleaseDate2.Text.Trim(), "ReleaseDate");
                }
                return "";
            }
        }

        public string ReleaseID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReleaseID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReleaseID.Text.Trim(), this.ddlReleaseID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }
    }
}

